<?php
class Mysqli
{
    public function connect_db($host='localhost',$user='root',$password='root',$port=3306){
        $mySQLi = new MySQLi($host,$user,$password,$port);
        if($mySQLi->connect_errno){
            die('连接错误' . $mySQLi->connect_error);
        }
        $mySQLi->set_charset('utf8');//设置字符集
        //return $mySQLi;
    }
}
?>